#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int GetType(char* p)
{
	if (strcmp(*p,"char"))
	{
		return 1;
	}
	//if (strcmp(*p, "int") == 0)
	//{
	//	return 4;
	//} 
	//if (strcmp(*p, "long") == 0)
	//{
	//	return 4;
	//}
	//if (strcmp(*p, "long long") == 0)
	//{
	//	return 8;
	//}
	//if (strcmp(*p, "__int128") == 0)
	//{
	//	return 16;
	//}
	//if (strcmp(*p, "float") == 0)
	//{
	//	return 4;
	//}
	//if (strcmp(*p, "duoble") == 0)
	//{
	//	return 8;
	//}
	//if (strcmp(*p, "long double") == 0)
	//{
	//	return 16;
	//}
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	getchar();
	int num[1000] = { 0 };
	char type[20] = { 0 };
	for (int i = 0; i < n; i++)
	{
		gets(type);
		num[i] = GetType(type);
	}
	for (int i = 0; i < n; i++)
	{
		printf("%d\n", num[i]);
	}
	return 0;
#include<stdio.h>
#include<string.h>
	int GetType(const char* p)
	{
		if (strcmp(p, "char") == 0)
		{
			return 1;
		}
		if (strcmp(p, "int") == 0)
		{
			return 4;
		}
		if (strcmp(p, "long") == 0)
		{
			return 4;
		}
		if (strcmp(p, "long long") == 0)
		{
			return 8;
		}
		if (strcmp(p, "__int128") == 0)
		{
			return 16;
		}
		if (strcmp(p, "float") == 0)
		{
			return 4;
		}
		if (strcmp(p, "double") == 0)
		{
			return 8;
		}
		if (strcmp(p, "long double") == 0)
		{
			return 16;
		}
	}
	int main()
	{
		int n = 0;
		scanf("%d", &n);
		getchar();
		int num[1000] = { 0 };
		char type[20] = { 0 };
		for (int i = 0; i < n; i++)
		{
			gets(type);
			num[i] = GetType(type);
		}
		for (int i = 0; i < n; i++)
		{
			printf("%d\n", num[i]);
		}
		return 0;
	}